<!-- inc:frame.top -->

<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=category&act=list&sysgroupid={:$sysgroupid}">{:$group[groupname]}</a> &raquo; 内容列表</p><!-- inc:position.fr --></div>

<form method="post" action="{:$mainlink}?file=msg&act=list&sysgroupid={:$sysgroupid}">
<table class="stable">
  <tr>
    <td class="left">&nbsp;&nbsp;&nbsp;&nbsp;分类：</td>
    <td class="right">
      <table class="ftable">
        <tr>
          <td>
            <select onchange="changese(this)">
              <option disabled>选择分类...</option>
              <!-- $catelist AS $key=>$value -->
              <option value="{:$value[id]}"{if($cateid == $value[id])} selected{end}>{:$value[space]}{:$value[catename]}</option>
              <!-- end -->
            </select>
            <input type="hidden" name="cateid" id="cateid" value="{:$cateid}" />
          </td>
          <!-- if($proID) -->
          <td>主题：<input class="ginput ginput_minhei" type="text" value="{:$additon[subject]}" disabled="disabled" /></td>
          <!-- end -->
          <td>关键字：<input class="ginput ginput_minhei" type="text" name="keywords" id="keywords" value="{:$keywords}" /></td>
          <td>时间段：<input class="ginput ginput_minhei" style="width:100px; min-width:auto;" type="text" name="s_time" id="s_time" value="{:$s_time}" readonly="readonly" /></td>
          <td>-</td>
          <td><input class="ginput ginput_minhei" style="width:100px; min-width:auto;" type="text" name="e_time" id="e_time" value="{:$e_time}" readonly="readonly" /></td>
          <td><button class="gbutton" type="submit">搜索</button></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form>
<link href="css/laydate.css" type="text/css" rel="stylesheet" />
<script src="js/laydate.js"></script>
<script>
function changese(o)
{
	url = "{:$mainlink}?file=msg&act=list&sysgroupid={:$sysgroupid}&cateid="+o.value;
	self.location.href=url;
}

laydate.render({
	elem: '#s_time',
	theme: '#3a6ea5'
});
laydate.render({
	elem: '#e_time',
	theme: '#3a6ea5'
});
</script>

<div class="page_pad">
  <div class="content_add">
    <button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$r_url}&act=add&sysgroupid={:$sysgroupid}{if($proID)}&proID={:$proID}{end}{if($cateid)}&cateid={:$cateid}{end}')">添加<!-- if($proID) -->附加信息<!-- else -->内容<!-- end --></button>
    <button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="tip_uppic('批量上传','{:$mainlink}?file=upfiles&act=upfiles&sysgroupid={:$sysgroupid}{if($cateid)}&cateid={:$cateid}{end}{if($proID)}&additonid={:$proID}{end}&single=1')">批量上传</button>
	<button class="gbutton gbutton_dblue gbutton_add" name="button" type="button" onclick="qgurl('{:$mainlink}?file=msg&act=neworderlist&sysgroupid={:$sysgroupid}{if($proID)}&otherid={:$proID}{end}{if($cateid)}&cateid={:$cateid}{end}')">内容排序</button>
	<!-- if($proID) -->
	<button class="gbutton gbutton_add" name="button" type="button" onclick="qgurl('{:$mainlink}?file=msg&act=list&sysgroupid={:$sysgroupid}&proID={:$upadditon[id]}{if($cateid)}&cateid={:$cateid}{end}')">返回</button>
	<!-- else -->
	<button class="gbutton gbutton_dblue gbutton_add" name="button" type="button" onclick="qgurl('{:$mainlink}?file=msg&act=orderauto&sysgroupid={:$sysgroupid}{if($cateid)}&cateid={:$cateid}{end}')">一键排序</button>
    <button class="gbutton gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=category&act=list&sysgroupid={:$sysgroupid}')">返回</button>
	<!-- end -->
  </div>

  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr class="first">
          <td width="30">&nbsp;</td>
          <td width="50">ID</td>
          <td width="100">分类</td>
          <td width="100">发布者</td>
          <!--<td width="110">缩略图</td>-->
          <td align="left">主题</td>
          <!-- if($group[is_album]) --><!-- if(!$proID) --><td width="160">附加信息</td><!-- end --><!-- end -->
          <td width="30">上架</td>
          <td width="30">新品</td>
          <td width="80">点击率</td>
          <td width="80">发布时间</td>
          <td width="220">操作</td>
        </tr>
        <!-- $msglist AS $key=>$value -->
        <tr>
          <td><div class="check_zw"><input type="checkbox" name="qg_id[]" value="{:$value[id]}"><span></span></div></td>
          <td>{:$value[id]}</td>
          <td><div class="msglist"><a href="{:$mainlink}?file=msg&act=list&sysgroupid={:$sysgroupid}&cateid={:$value[cateid]}">{:$value[catename]}</a></div></td>
          <td><div class="msglist"> <!--if($value['user_id']>0)-->{:get_user_name($value[user_id])}<!--else-->--<!--end--> </div></td>
         <!-- <td>
            &lt;!&ndash; if($value[thumb]) &ndash;&gt;
            &lt;!&ndash; if(file_exists($value[folder].$value[filename])) &ndash;&gt;
            <img class="msglist_img" src="{:$value[folder]}{:$value[thumbfile]}" onclick="tip_img('{:$value[folder]}{:$value[filename]}')" />
            &lt;!&ndash; else &ndash;&gt;
            <img src="images/thumb_h.gif" />
            &lt;!&ndash; end &ndash;&gt;
            &lt;!&ndash; else &ndash;&gt;
            <img src="images/noimage.png" />
            &lt;!&ndash; end &ndash;&gt;
          </td>-->
          <td align="left">
            <div class="msglist">
            {:$value[subject]}
            <!-- if($system[fanti] == on) --><!-- if($value[subject_ft]) --> | {:$value[subject_ft]}<!-- end --><!-- end -->
            <!-- if($system[english] == on) --><!-- if($value[subject_en]) --> | {:$value[subject_en]}<!-- end --><!-- end -->
            <!-- if($value[istop]==1) --><span style="color:red;">[置顶]</span><!-- end -->
            <!-- if($value[isrecommend]==1) --><span style="color:red;">[首页推荐]</span><!-- end -->
            </div>
          </td>
          <!-- if($group[is_album]) --><!-- if(!$proID) --><td><a href="{:$mainlink}?file=msg&act=list&sysgroupid={:$sysgroupid}&proID={:$value[id]}&cateid={:$value[cateid]}"><span style="color:red; text-decoration:underline;">浏览({:$value[count]})</span></a> &nbsp; <a href="javascript:void(0)" onclick="tip_uppic('批量上传','{:$mainlink}?file=upfiles&act=upfiles&sysgroupid={:$sysgroupid}&cateid={:$value[cateid]}&additonid={:$value[id]}&single=1')"><span style="color:red; text-decoration:underline;">上传图片</span></a></td><!-- end --><!-- end -->
          <td><img style="cursor:pointer;" src="images/<!-- if($value[ifcheck]) -->yes.png<!-- else -->cancel.png<!-- end -->" onclick="changeTableVal('msg','id','{:$value[id]}','ifcheck',this)"/></td>
          <td><img style="cursor:pointer;" src="images/<!-- if($value[isvouch]) -->yes.png<!-- else -->cancel.png<!-- end -->" onclick="changeTableVal('msg','id','{:$value[id]}','isvouch',this)"/></td>
          <td>{:$value[hits]}</td>
          <td>{:$value[postdate]}</td>
          <td><button class="gbutton{if($fieldgroup)} gbutton_min{end}" type="button" onclick="qg_modify({:$value[id]})">编辑</button> &nbsp; <button class="gbutton{if($fieldgroup)} gbutton_min{end}" type="button" onclick="to_delete({:$value[id]})">删除</button><!-- if($fieldgroup) --> &nbsp; <button class="gbutton gbutton_min" type="button" onclick="qgurl('{:$mainlink}?file=msg&act=field&sysgroupid={:$sysgroupid}&id={:$value[id]}')">字段方案</button><!-- end --></td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->

  <div class="content_ctrl">
    <button class="gbutton gbutton_min" type="button" value="" onclick="select_all();upsele();">全选</button>
    <button class="gbutton gbutton_min" type="button" value="" onclick="revCheck();upsele();">反选</button>
    <button class="gbutton gbutton_min" type="button" value="" onclick="selectNone();upsele();">全不选</button>
    <button class="gbutton gbutton_min" type="button" value="" onclick="qg_pl('check')">审核</button>
    <button class="gbutton gbutton_min" type="button" value="" onclick="qg_pl('dcheck')">未审核</button>

    <select name="act_plset" id="act_plset">
      <option value="0">请选择方案</option>
      <optgroup label="属性设置">
        <option value="top">置顶</option>
        <option value="dtop">取消置顶</option>
        <option value="vouch">设为新品</option>
        <option value="dvouch">取消新品</option>
        <option value="recommend">首页推荐</option>
        <option value="drecommend">取消首页推荐</option>
      </optgroup>
      <optgroup label="删除主题">
        <option value="delete">批量删除</option>
        <!-- if($_SESSION[admin][typer] == "system") --><option value="deletepic">彻底删除(包括图片)</option><!-- end -->
      </optgroup>
      <optgroup label="移动主题分类">
        <!-- $catelist AS $key=>$value -->
        <option value="move:{:$value[id]}">{:$value[space]}{:$value[catename]}</option>
        <!-- end -->
      </optgroup>
      <!-- if($group[is_album]) -->
      <optgroup label="移动到相册">
        <option value="additon:0">移出相册</option>
        <!-- $msglist AS $key=>$value -->
        <option value="additon:{:$value[id]}">{:$value[space]}{:$value[subject]}</option>
        <!-- end -->
      </optgroup>
      <!-- end -->
    </select>
    <button class="gbutton gbutton_min" type="button" onclick="update_pl()">提交</button>

    <div class="content_pagelist">{:$pagelist}</div>
  </div><!--content_ctrl-->
</div><!--page_pad-->

<script type="text/javascript">
$(function(){
	$(".ltable tr").click(function () {
		cbox = $(this).find("input[type='checkbox']")
		if(cbox.prop("checked")==true)
		{
			$(this).removeClass("selected");
			cbox.prop("checked",false).attr("checked",false);
		}
		else
		{
			$(this).addClass("selected");
			cbox.prop("checked",true).attr("checked",true);
		}
	});
});

//选择后修改样式
function upsele()
{
	cbox_all = $("input[type='checkbox']");
	$(cbox_all).each(function(){
		if($(this).prop("checked")==true)
		{
			$(this).parents("tr").addClass("selected");
		}
		else
		{
			$(this).parents("tr").removeClass("selected");
		}
	});
}

function update_pl()
{
	var act = document.getElementById("act_plset").value;
	act_arr = act.split(":");
	if(act_arr[1])
	{
		qg_pl(act_arr[0],act_arr[1]);
	}
	else
	{
		if(act_arr[0]==0)
		{
			tip_alert("请选择方案");
			return false;
		}
		else
		{
			qg_pl(act_arr[0]);
		}
	}
}
function qg_modify(id)
{
	qgurl("{:$mainlink}?file=msg&act=modify&sysgroupid={:$sysgroupid}&id="+id+"{if($proID)}&proID={:$proID}{end}");
}
function qg_pl(qgtype,theid)
{
	var idarray = new Array();//定义一个数组
	var cv = document.getElementsByTagName("input");
	var m = 0;
	for(var i=0; i<cv.length; i++)
	{
		if(cv[i].type.toLowerCase() == "checkbox")
		{
			if(cv[i].checked)
			{
				idarray[m] = cv[i].value;
				m++;
			}
		}
	}
	var id = idarray.join(",");
	if(!id || id == "0")
	{
		tip_alert("没有勾选要操作的主题！");
		return false;
	}
	var url;
	if(qgtype == "delete")
	{
		url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&qgtype=" + qgtype + "&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
		tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
	}
	else if(qgtype == "deletepic")
	{
		url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&qgtype=" + qgtype + "&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
		tip_confirm("确认彻底删除该信息吗？特别说明，删除后无法恢复！",url);
	}
	else if(qgtype == "move")
	{
		url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&moveid=" + theid + "&qgtype=" + qgtype + "&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
		tip_confirm("确认移动主题吗？",url);
	}
	else if(qgtype == "additon")
	{
		url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&additonid=" + theid + "&qgtype=" + qgtype + "&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
		tip_confirm("确认移动到相册吗？",url);
	}
	else
	{
		url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&qgtype=" + qgtype + "&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
		qgurl(url);
	}
}

function to_delete(id)
{
	url = "{:$mainlink}?file=msg&act=plset&idlist=" + id + "&qgtype=delete&sysgroupid={:$sysgroupid}&cateid={:$cateid}<!-- if($proID) -->&proID={:$proID}<!-- end -->";
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
</script>

<!-- inc:frame.bottom -->